package com.xxbb.chapter_4.dome3;

public class FruitFactory {
  public  static Fruit getInstance(String type){
      if (type.equals("apple")){
          return new Apple();
      }else if (type.equals("orange")){
          return new Orange();
      }
      return null;
  }
}
